home *** CD-ROM | disk | FTP | other *** search
- Path: news.computek.net!usenet
- From: robert jacobs and jason jacobs <robertj@computek.net>
- Newsgroups: comp.lang.c
- Subject: Re: line intersection in C
- Date: Wed, 28 Feb 1996 11:39:06 -0600
- Organization: Compu-Net DFW's Premiere Internet Access Provider
- Message-ID: <3134933A.AB9@computek.net>
- References: <1996Feb25.230142.29689@dcs.warwick.ac.uk>
- NNTP-Posting-Host: dal834.computek.net
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0 (Win95; I)
-
- Daniel Castillo Molero wrote:
- >
- > Hello,
- >
- > I wonder if anybody can help me to find an algorithm in C to detect whether
- > two line segments intersect properly (I don't know if this is the correct
- > terminology, but by proper intersection I mean that the intersection is
- > not in the extreme of any of them and that one does not lie on top of
- > the other).
- > I need to test intersection just for line segments whose slope is a multiple
- > of 45 degrees, which I suppose may simplify the solution.
- >
- > I would greatly appreciate any sort of help.
- >
- > Daniel Castillo.
- >
- > danmol@dcs.warwick.ac.uk
- >
- > --
- > * Daniel Castillo. D.C.Molero@dcs.warwick.ac.uk *
-
- Plug the end points of line segements into the equation for a line.
- Calculate the slope of the lines. If the slopes are defferent the lines
- will intersect.
-
- Bob Jacobs
-